package oop;

import java.awt.*;

import javax.swing.*;
import javax.swing.border.TitledBorder;

public class EmployeeFind extends JFrame{
        private static final long serialVersionUID = 1L;
    private Font f;
    private JPanel p;
    private JLabel Label_Header,Label_Search,Label_EmployeeCode,Label_Lastname,Label_Name;
    private JTextField Text_EmployeeCode,Text_Name,Text_Lastname;
    private JButton Button_ok,Button_cancel;
         
          
    public EmployeeFind(){
        super("EmployeeFind");
        setLayout(null);
        p = new JPanel(null);
        p.setBorder(BorderFactory.createTitledBorder(null, "Employee Find", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION,new Font("Segoe UI",Font.PLAIN,14)));
            setComponent();
            p.setBounds(5, 5, 383, 225);
            add(p);
            setBounds(455,160,409,272);
        }
    
    public void setComponent(){
       
        f = new Font("Tahoma",Font.PLAIN,12);
        
                
         //Create
        Label_Header = new JLabel("EMPLOYEE FIND");
        Label_Search = new JLabel("ค้นหาพนักงาน..");            
        Label_EmployeeCode = new JLabel("รหัสพนักงาน:");               
        Label_Name = new JLabel("ชื่อ:");              
        Label_Lastname = new JLabel("สกุล:");                          
        Text_EmployeeCode = new JTextField();           
        Text_Name = new JTextField() ;          
        Text_Lastname= new JTextField() ;               
        Button_ok = new JButton("ตกลง");
        Button_cancel = new JButton("ยกเลิก");
                
        //Set font
        Label_Header.setFont(new Font("Segoe UI",Font.BOLD,18));
        Label_Search.setFont(new Font("Tahoma",Font.PLAIN,11));
        Label_EmployeeCode.setFont(f);
        Label_Name.setFont(f);
        Label_Lastname.setFont(f);
        Text_EmployeeCode.setFont(f);
        Text_Name.setFont(f);
        Text_Lastname.setFont(f);
        Button_ok.setFont(new Font("Tahoma",Font.PLAIN,11));
        Button_cancel.setFont(new Font("Tahoma",Font.PLAIN,11));
        
        //Add
        add(Label_Header);
        add(Label_Search);
        add(Label_EmployeeCode);
        add(Label_Name);
        add(Label_Lastname);
        add(Text_EmployeeCode);
        add(Text_Name);
        add(Text_Lastname);
        add(Button_ok);
        add(Button_cancel);
        
        //setBounds
        Label_Header.setBounds(20, 25, 150, 20);
        Label_Search.setBounds(20, 45, 90, 20);
        Label_EmployeeCode.setBounds(65, 70, 90, 20);
        Label_Name.setBounds(110, 105, 90, 20);
        Label_Lastname.setBounds(105, 140, 90, 20);
        Text_EmployeeCode.setBounds(140, 75, 125, 20);
        Text_Name.setBounds(140, 110, 125, 22);
        Text_Lastname.setBounds(140, 145, 125, 20);     
        Button_ok.setBounds(280, 75,85,25);
        Button_cancel.setBounds(280, 105,85,25);
        
        //setIcon
        Button_ok.setIcon(new javax.swing.ImageIcon("D:\\Project\\src\\pic\\ok.png"));
        Button_cancel.setIcon(new javax.swing.ImageIcon("D:\\Project\\src\\pic\\Delete.png"));
        }
    }